<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" href="/icon.png" type="image/png">
<link rel="shortcut icon" href="/icon.png" type="image/png">
<title>zuChat Stats</title>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>

<script type="text/javascript">

$(document).ready(function(){
	getStats();
});

function getStats(){
	$.ajax({
		type: "POST",
		url: "statsvalues",
		dataType: "json",
		cache: false,
		success: function(data){
			setTimeout("getStats();", 300);
			handleStats(data);
		},
		error: function(XMLHttpRequest, textStatus, errorThrown){
			setTimeout("getStats();", 300);
			handleStats(data);
		}  
	});
}

function handleStats(data){
	
	var statsNamesString = "";
	var statsValuesString = "";
	
	for (var i = 0; i < data.length; i++){
		statsNamesString += data[i][0] + "<br>";
		statsValuesString += data[i][1] + "<br>";
	}
	
	$('#statsNames').html(statsNamesString);
	$('#statsValues').html(statsValuesString);
}
</script>

</head>

<body>


<div id="statsNames" style='float:left; margin-right:10px;'>

</div>

<div id="statsValues" style='float:left;'>

</div>
<br style='clear:both' />

</body>
</html>
